import { post } from "@/utils";

export type LoginData = {
  username: string;
  password: string;
};

interface LoginDataReturn<T extends object = object> {
  data: T;
  meta: {
    msg: string;
    status: number;
  };
}

interface LoginDatas {
  email: string;
  id: number;
  mobile: string;
  rid: number;
  token: string;
  username: string;
}
const login = (data:LoginData) =>post<LoginData,LoginDataReturn<LoginDatas>>("/login", data);

export default login;
